<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>



<script>
    var test = 20;
    test = "桔子"

    alert(test)

    /*
    * var
    *   1.作用域：全局变量
    *   2.变量可以重复，后面覆盖前面
    *
    * let
    *   1.作用域：局部变量
    *   2.变量不能重复
    * const
    *   用来声明一个只读常量。一旦声明，常量值不能被改变
    * */

    {
        var age = 30;
        var age = 20;
        // let ages = 10;
        let ages = 10;
        alert(ages)
    }
    alert(age);
    // alert(ages)

    const PI =" ≈ 3.1415926535";
    // PI = 3;//报错，不能改变常量值

    var flag = true;
    var flag2 = false;
    var object ;
    var project = null;
    alert(typeof object);
    alert(typeof project);
    alert(flag);
    alert(flag2);

</script>
</body>
</html>